<template lang="">
  <div>
    <h1>Rights</h1>
    
    <el-table :data="list" stripe border>
      <el-table-column
        label="#"
        prop="id">
      </el-table-column>
      <el-table-column
        label="权限名称"
        prop="authName">
      </el-table-column>
      <el-table-column
        label="路径"
        prop="path">
      </el-table-column>
      <el-table-column
        label="等级"
        prop="level">
        <template slot-scope="scope">
          <el-tag effet="dark" type='danger' v-if="scope.row.level==0">一级</el-tag>
          <el-tag effet="dark" type="warning" v-else-if="scope.row.level==1">二级</el-tag>
          <el-tag effet="dark" type="success" v-else>三级</el-tag>
        </template>
      </el-table-column>
    </el-table>
    
  </div>
</template>
<script>
export default {
  name: "Rights",
  data() {
    return {
      list: []
    }
  },
  async created() {
    let { data: res } = await this.$axios({ url: "rights/list" }).catch(err => err)
    // console.log(res)
    if (res.meta.status !== 200) return this.$message.error("数据请求错误")
    this.list = res.data
  }

}
</script>
<style lang="">
  
</style>